import { createRouter, createWebHashHistory } from "vue-router";
import Login from "../views/Login.vue";
const routes = [
  {
    path: "/",
    name: "Loing",
    component: Login,
  },
  {
    path: "/main",
    name: "Main",
    redirect: "/main/index",
    component: () => import("../views/Main.vue"),
    children: [
      {
        path: "index",
        name: "Index",
        component: () => import("../components/Main/Children/Index.vue"),
      },
      {
        path: "user-management",
        name: "UserManagement",
        component: () =>
          import("../components/Main/Children/UserManagement.vue"),
      },
      {
        path: "os-detail",
        name: "OsDetail",
        component: () => import("../components/Main/Children/OsDetail.vue"),
      },
      {
        path: "goods-manage",
        name: "GoodsManage",
        component: () =>
          import("../components/Main/Children/Goods/GoodsManage.vue"),
      },
    ],
  },

  {
    path: "/:pathMatch(.*)*",
    name: "notFound",
    component: () => import("../views/404.vue"),
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
